﻿Namespace Facturacion
    Public Class Factura
        Private _detalles As List(Of DetalleDeFactura) = New List(Of DetalleDeFactura)
        Public Property Detalles() As List(Of DetalleDeFactura)
            Get
                Return _detalles
            End Get
            Set(ByVal value As List(Of DetalleDeFactura))
                _detalles = value
            End Set
        End Property

        Private _fechaDeEmision As Date
        Public Property FechaDeEmision() As Date
            Get
                Return _fechaDeEmision
            End Get
            Set(ByVal value As Date)
                _fechaDeEmision = value
            End Set
        End Property

        Private _fechaDeVencimiento As Date
        Public Property FechaDeVencimiento() As Date
            Get
                Return _fechaDeVencimiento
            End Get
            Set(ByVal value As Date)
                _fechaDeVencimiento = value
            End Set
        End Property

        Public Function ObtenerTotal() As Double
            Dim total As Double = 0
            For Each detalle In Detalles
                total += detalle.ObtenerSubtotal()
            Next
            Return total
        End Function
    End Class
End Namespace